package com.ddai.test.releaseview;

import com.ddai.test.reuse.ReuseTest1Activity;
import com.ddai.test.reuse.ReuseTest2Activity;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;

public class MainActivity extends Activity implements OnClickListener {

	Button bt1, bt2, bt3, bt4, bt5, bt6, bt7, bt8, bt9;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.mian);
		bt1 = (Button) findViewById(R.id.button1);
		bt2 = (Button) findViewById(R.id.button2);
		bt3 = (Button) findViewById(R.id.button3);
		bt4 = (Button) findViewById(R.id.button4);
		bt5 = (Button) findViewById(R.id.button5);
		bt6 = (Button) findViewById(R.id.button6);
		bt7 = (Button) findViewById(R.id.button7);
		bt8 = (Button) findViewById(R.id.button8);
		bt9 = (Button) findViewById(R.id.button9);
		bt1.setOnClickListener(this);
		bt2.setOnClickListener(this);
		bt3.setOnClickListener(this);
		bt4.setOnClickListener(this);
		bt5.setOnClickListener(this);
		bt6.setOnClickListener(this);
		bt7.setOnClickListener(this);
		bt8.setOnClickListener(this);
		bt9.setOnClickListener(this);
		bt1.setText("Reuse Test 1");
		bt2.setText("Reuse Test 2_0");
		bt3.setText("Reuse Test 2_1");
		bt4.setText("Reuse Test 2_2");
		bt5.setText("Reuse Test 2_3");

	}

	@Override
	public void onClick(View v) {
		Intent intent = null;
		if (v.getId() == bt1.getId()) {
			intent = new Intent(this, ReuseTest1Activity.class);
		} else if (v.getId() == bt2.getId()) {
			intent = new Intent(this, ReuseTest2Activity.class);
			intent.putExtra("RES", R.layout.reuse2_0);
		} else if (v.getId() == bt3.getId()) {
			intent = new Intent(this, ReuseTest2Activity.class);
			intent.putExtra("RES", R.layout.reuse2_1);
		} else if (v.getId() == bt4.getId()) {
			intent = new Intent(this, ReuseTest2Activity.class);
			intent.putExtra("RES", R.layout.reuse2_2);
		} else if (v.getId() == bt5.getId()) {
			intent = new Intent(this, ReuseTest2Activity.class);
			intent.putExtra("RES", R.layout.reuse2_3);
		}
		if (intent != null) {
			startActivity(intent);
		}
	}

}
